// 函数
// 内容
// 1. 常规函数
// 2. 可选传参
// 3. 函数对象
// 4. 匿名函数
// 5. 箭头函数

void main() {
  fn1('kobe');

  fn2();
  fn2(name: 'jojo');

  fn3();
  fn3(name: 'koko', age: 23);

  var func = fn3;
  func(name: 'func');

  fn4((){
    print('my callback');
  });

  print(fn5(2, 3));
}

fn1(String name) {
  print('fn1 $name');
}

fn2({String? name}){
  print('fn2 $name');
}

fn3({String? name, int? age}){
  print('fn3 $name , $age');
}

fn4(callback){
  print('fn4');
  callback();
}


int fn5(int a, int b) => a+b;
